<?php
/**
 * Created by PhpStorm.
 * User: qishengqiang
 * Date: 2021-09-16
 * Time: 19:20
 */

namespace app\models;


class UserAnswerRecords extends ModelBase
{
    protected $pk = 'userAnswerId';

    public function question()
    {
        return $this->hasOne(Questions::class, 'questionId', 'questionId');
    }

    public function user()
    {
        return $this->hasOne(Users::class, 'userId', 'userId');
    }

    public function getRightText()
    {
        return $this->isRight == 1? '正确': '错误';
    }
}